export default ({ streamServerIp, streamServerPort, token, doMainName, flvUrl, hlsUrl } = {}) => {
  const { protocol } = window.location;
  if (flvUrl) {
    return flvUrl;
  }
  if (hlsUrl) {
    return hlsUrl;
  }
  if (protocol === 'http:' || !doMainName) {
    return `http://${streamServerIp}:${streamServerPort}/play.flv?token=${token}&streamnum=0`;
  }
  return `${doMainName}/play.flv?token=${token}&streamnum=0`;
};
